package com.example.planetexploder.model.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

import com.example.planetexploder.constants.ShelfConst;

/**
 * 数据库操作助手
 * @author 宋熙然
 * 修改日期：2019.10.15
 * 测试完毕
 */
public class DBHelper extends SQLiteOpenHelper {

     /**
     * 数据库名称
     */
    public static final String DATABASE_NAME = "database.db";

    public DBHelper(@Nullable Context context) {
        super(context, DBHelper.DATABASE_NAME, null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "CREATE TABLE " + ShelfConst.SHELF_NAME + ShelfConst.SHELF_HEADER;
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {

    }
}
